package com.budwk.app.jim.server;

import cn.hutool.core.text.StrFormatter;
import org.jim.core.ImChannelContext;
import org.jim.core.exception.ImException;
import org.jim.core.packets.User;
import org.jim.server.listener.AbstractImUserListener;

/**
 * @author ZY.Wang
 * @since 2023/6/14
 */
public class ImUserListener extends AbstractImUserListener {

    @Override
    public void doAfterBind(ImChannelContext imChannelContext, User user) throws ImException {
        System.out.println(StrFormatter.format("用户{}已经上线",user.getNick()));
    }

    @Override
    public void doAfterUnbind(ImChannelContext imChannelContext, User user) throws ImException {
        System.out.println(StrFormatter.format("用户下线"));
    }
}
